package com.ss.android.lockscreen.component;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.net.Uri;
import android.text.TextUtils;
import java.util.ArrayList;
import java.util.List;

public final class c extends Thread {
    public final a a;
    private final boolean b;
    private final List c;
    private final int d;
    private final String[] e;

    public c(a arg1, boolean arg2, List arg3, int arg4, String[] arg5) {
        this.a = arg1;
        this.b = arg2;
        this.c = arg3;
        this.d = arg4;
        this.e = arg5;

    }

    public final void run() {
        int v0 = 1;
        int v1 = 0;
        ContentResolver v2 = this.a.getContentResolver();
        ContentValues v3 = new ContentValues();
        String v4 = "setting_state";
        if(!this.b) {
            v0 = 0;
        }

        v3.put(v4, Integer.valueOf(v0));
        com.ss.android.lockscreen.component.a.a(this.a, new ArrayList(3));
        com.ss.android.lockscreen.component.a.c(this.a).addAll(this.c);
        while (v1 < this.d) {
            try {
                if(v2.update(Uri.parse(this.e[v1]), v3, "package_name = ?", new String[]{(String) this.c.get(v1)}) < 0) {
                    if(TextUtils.equals((CharSequence) this.c.get(v1), this.a.getPackageName())) {
                    }else {
                        this.a.a((String) this.c.get(v1), this.b);
                    }
                }else {
                    com.ss.android.lockscreen.component.a.c(this.a).remove(this.c.get(v1));
                    this.a.runOnUiThread(new d(this));
                }
                ++v1;
            }
            catch(Exception v0_1) {
                this.a.a((String) this.c.get(v1), this.b);
                ++v1;
            }
        }
    }
}

